<template>
    <div style="height: 100%;">
      <div class="content">
          <keep-alive>
            <router-view v-if="$route.meta.keepAlive"></router-view>
          </keep-alive>
          <router-view v-if="!$route.meta.keepAlive"></router-view>
      </div>
    </div>
</template>

<script type="text/ecmascript-6">
  import functionalTool from '../../../utils/functionTools';
  import {getActivityInfo} from '../../../mock/mock';
  export default {
    name: 'timeline',
    data () {
      return {
        accountId: functionalTool.getUrlParam('accountId'),
        city: functionalTool.getUrlParam('city'),
        activeInfo: {}
      }
    },
    mounted () {
      this.ActivityInfo();
    },
    methods: {
      async ActivityInfo (param) {
        if (param) {
          this.accountId = param.accountId;
          this.city = param.city;
        }
        try {
          const resData = await getActivityInfo({
            accountId: this.accountId,
            city: this.city
          });
          if (resData.data.code === '200') {
            let resInfo = resData.data.data;
            resInfo['accountId'] = this.accountId;
            resInfo['city'] = this.city;
            this.$root.eventBus.$emit('activeInfo', resInfo);
          }
        } catch (e) {
          console.log(e);
        }
      }
    }
  }
</script>

<style rel="stylesheet/stylus" lang="stylus">
  @import "../../../assets/css/mixin.styl";
  .content
    height 100%
    background-color #543ad0
</style>
